package com.itheima.mapper;

import com.itheima.domain.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface HelloMapper {

    @Select("select *from book")
    List<Book> findAll();

    @Delete("delete book where id = #{id}")
    void delete(int id);


   /* @Update("update book set bookname = #{bookname} where id = #{id}")
    void update(@Param("id") int id, @Param("bookname") String bookname);*/

    @Update("update book set bookname = #{param2} where id = #{param1}")
    void update(int id,  String bookname);
}
